package com.hqyj.finance.server.invest.financeinvest.controller;

import com.hqyj.finance.server.invest.financeinvest.json.R;
import com.hqyj.finance.server.invest.financeinvest.service.StockIndexsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("indexs") //stock/indexs 查询股指信息的接口
@RestController
public class StockIndexController {

    @Resource
    private StockIndexsService stockIndexsService;

    @GetMapping("all")
    public R queryAllStockIndexsRealInfo(){
        try{
            String result = stockIndexsService.queryAllStockIndexRealInfo();
            return R.success("查询股指实时行情成功！",result);
        }catch (Exception ex){
            ex.printStackTrace();
            return R.error("程序出现异常！");
        }
    }
}
